var srt=getCookie("coo");
var srt1=getCookie("coo1");
console.log(srt)
console.log(srt1)
$("#dongtaimima").click(function(){
	$("#denglu").css("display","none")
	$("#denglu2").css("display","block")
	
})
$("#dongtaimima2").click(function(){
	$("#denglu2").css("display","none")
	$("#denglu").css("display","block")
})
// 验证input1
var shouji=((/^13\d{9}$/ )|(/^\w+@\w+(\.\w+)+$/));;
var span1=document.getElementById("span1")

input1.onclick=input2.onclick=input3.onclick=input4.onclick=input5.onclick=function(){
this.value=""
}	

function in1(){
	var span4=document.getElementById("span4")
	if(int1=input1.value.match(shouji)){span4.style.display="none";	
	}
	else{span4.style.display="block";}
	if(input1.value==""){span1.style.display="block"
	}
	else{span1.style.display="none";}
}

function in2(){

	var span2=document.getElementById("span2")
	var span5=document.getElementById("span5")
	if(input2.value.length>=6&&input2.value.length<=12){	
		span5.style.display="none";
	}else{span5.style.display="block";}
	if(input2.value==""){span2.style.display="block"
	}
	else{span2.style.display="none";}
}

function in3(){

	var span3=document.getElementById("span3")
	
	if(int1=input3.value.match(shouji)){	
		span3.style.display="none";
	}else{span3.style.display="block";}
	
}

//验证码
function rndCode(){
	var str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	var len = str.length;
	var ind1 = parseInt(Math.random()*len);
	var ind2 = parseInt(Math.random()*len);
	var ind3 = parseInt(Math.random()*len);
	var ind4 = parseInt(Math.random()*len);
	return str[ind1]+str[ind2]+str[ind3]+str[ind4];
}

//// 把随机验证码显示在页面上
yanzhengmama.innerHTML = rndCode();	// 先执行函数，该函数的返回值，赋给innerHTML属性上
// 刷新验证码
yanzhengmama.onclick = function(){
	yanzhengmama.innerHTML = rndCode();
}

var srt=getCookie("coo");
var srt1=getCookie("coo1");
console.log(srt)
sum.onclick=function(){

if(input1.value==srt&&input2.value==srt1){
	alert("登录成功")
}else{alert("重新登录")}
console.log(srt)
}
	
input1.onblur = in1;
input2.onblur = in2;
input3.onblur = in3;

